Skip to content

Add emojis by default #4535

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ViniDevBR
Copy link

Just changes to add emojis by default

Description

user send emoji inside commitlint.config.js
i use this info to show the emoji inside CZ in the list. and when generate the commit, this get the emoji by value

Motivation and Context

Just for add emojis by default

Usage examples

// commitlint.config.js
import { UserConfig } from "@commitlint/types";
import gitmoji from 'commitlint-config-gitmoji'

/**
 * @type {import('@commitlint/types').UserConfig}
 */
module.exports = {
  extends: ['@commitlint/config-conventional'],
  prompt: {
    questions: {
      type: {
        description: "Select the type of change that you're committing",
        enum: {
          feat: {
            description: "A new feature",
            title: "Features",
            emoji: "✨",
          },
          fix: {
            description: "A bug fix",
            title: "Bug Fixes",
            emoji: "🐛",
          },
          docs: {
            description: "Documentation only changes",
            title: "Documentation",
            emoji: "📚",
          },
          style: {
            description:
              "Changes that do not affect the meaning of the code (linters)",
            title: "Styles",
            emoji: "🎨",
          },
          refactor: {
            description:
              "A code change that neither fixes a bug nor adds a feature",
            title: "Code Refactoring",
            emoji: "📦",
          },
          perf: {
            description: "A code change that improves performance",
            title: "Performance Improvements",
            emoji: "🚀",
          },
          test: {
            description: "Adding missing tests or correcting existing tests",
            title: "Tests",
            emoji: "🚨",
          },
          build: {
            description:
              "Changes that affect the build system or external dependencies (yarn)",
            title: "Builds",
            emoji: "🏗️ ",
          },
          ci: {
            description:
              "Changes to our CI configuration files and scripts (GitActions)",
            title: "Continuous Integrations",
            emoji: "⚙️ ",
          },
          chore: {
            description: "Other changes that don't modify src or test files",
            title: "Chores",
            emoji: "♻️ ",
          },
          revert: {
            description: "Reverts a previous commit",
            title: "Reverts",
            emoji: "⏪",
          },
        },
      },
    },
  },
  parserPreset: {
    parserOpts: gitmoji.parserPreset.parserOpts,
    plugins: [gitmoji.parserPreset.plugins],
  },
  ...gitmoji.rules,
  ...gitmoji.plugins
} as UserConfig
echo ":tada: feat(test): test" | commitlint # passes

How Has This Been Tested?

Just tested executing the code and making commits

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@escapedcat
Copy link
Member

Would this be the new default? This would be a breaking change I guess. We should be careful with this because this will affect all current usage of all users. Your commits do not indicate a breaking change, right?
You commits also do not follow conventional commits currently :) Please fix them.
Also checks are failing.
Please clean this PR up and try to get it green.

Double check if this really should be a new default or a new option which can be set to true if wanted but defaults to false.

/cc @curly210102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants